<?php

/*
Upgrade Account (admin_add_all_update.php)
*/

$page_title = "Add Update";
$rank_check = 7;
include "../header.inc.php";

if (($username == "steve") AND ($game == "1"))
{

if ($page == "update")
{

	$add_update = smilies($add_update);
		
	$findGames = mysql_query("SELECT * FROM game_tables");
	while ($getGames = mysql_fetch_array($findGames))
	{ 
		$add_update2 = eregi_replace("\(gameid\)", "$getGames[id]", $add_update);
		mysql_query("INSERT INTO updates2 (message,timestamp,game) VALUES ('$add_update2','$timestamp','$getGames[id]')");

	}
	
	mysql_query("UPDATE members2 SET viewed_update = '0'");
		
	header("Location: ../updates.php?game=$game&error=Your+update+has+been+added!");
}


if (!$page)
{

ECHO <<<END
$openHTML

<p>This is the perfect place to let all your users know about new features on your site! Updating often is a key to a successful game. So even if it's just letting everyone know of the new items or the winners of the lottery, you should let everyone know by using this form. Simply type in the update and click the "Add Update" button, it will then add the update and redirect you to the <a href=../updates.php?game=$game>updates page</a>.</p>

<P><FORM ACTION="admin_add_all_update.php?game=$game&page=update" METHOD=POST>
   <CENTER><TABLE BGCOLOR="$tableOutline" CELLSPACING=1 CELLPADDING=0 WIDTH=450>
      <TR BGCOLOR="$topAndBottomBG">
         <TD COLSPAN=2>
            <FONT SIZE="-1" COLOR="$topAndBottomText"><b>Add
            Update:</b></FONT>
         </TD>
      </TR>
      <TR BGCOLOR="#FFFFFF">
         <TD WIDTH=80 HEIGHT=40>
            <P>Update:</P>
         </TD>
         <TD HEIGHT=40>
            <P><FONT SIZE="-1">&nbsp;<TEXTAREA NAME="add_update" ROWS=10 COLS=50 WRAP=virtual></TEXTAREA></FONT></P>
         </TD>
      </TR>
      <TR>
         <TD COLSPAN=2 HEIGHT=30 BGCOLOR="$middleBG">
            <CENTER><FONT SIZE="-1" COLOR="$topAndBottomText"><I><INPUT TYPE=submit NAME=Submit VALUE="Add Update!!"></I></FONT></CENTER>
         </TD>
      </TR>
   </TABLE>
   </CENTER>
</FORM></P>
END;
	
}

print "$closeHTML";	

}

?>
